<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no">
		<title>报名成功</title>
		<link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/base.css" />
		
		<link rel="stylesheet" type="text/css" media="screen" href="{$staticHost}/static/css/competition.css?v=1" />
		<script src="{$staticHost}/static/js/jquery-1.8.3.min.js"></script>
		<script src="{$staticHost}/static/js/js.js"></script>
		<script src="{$staticHost}/static/js/mod.js"></script>
	</head>
	<body class="pay">
		<div id="box"></div>
		<script id="test" type="text/html">
			<h1 id="result"><i class="ico-success"></i><span>报名成功</span></h1>
			<p>预祝取得好成绩！</p>
			<section class="bg-skyblue">
				赛事名称<br>
				<%=name%><br/>
				<br/>
				赛事时间<br/>
				<%=stime%>
			</section>
			<a id="match">返回赛事页面</a>
			<a id="dtail" style="display:none">查看订单详情</a>
		</script>
	</body>
	<script>
	    var order_id = '{$order_id}';
        var match_id = '{$match_id}';
	    $(function(){
            var url = match_id!='0' ? "/matchWeb/matchInfo?match_id="+match_id : "/orderWeb/orderDetail?order_id="+order_id
			$.getJSON("{$staticHost}"+url, function(data, error) {
				var info = match_id!='0' ? data.result.matchInfo : data.result.orderInfo.actInfo;
	    		var status = match_id!='0' ? data.result.addInfo.status : data.result.orderInfo.pay_status;

				var d = new Date(parseInt(info.stime) * 1000);
				info.stime =d.getFullYear()+"."+xs(d.getMonth()+1)+"."+xs(d.getDate())+ " "+xs( d.getHours())+":"+xs(d.getMinutes());
				function xs(n){ return n<10?("0"+n):n;}
				
				var html = template('test', info);
				document.getElementById('box').innerHTML = html;
				if(order_id=="" || (status!='1' && status!='20')){
					$("#result i").removeClass("ico-success");
					$("#result i").addClass("ico-defeated");
					$("#result").css("color","#eb4f3f");
					$("#result span").html("报名失败");
					$("p").hide();
					$("#dtail").hide();
				}

				 $("#match").attr('href','{$staticHost}/show/matchInfo?match_id='+ info.match_id ) ;
			    if(order_id!=""&&order_id!=1){
			   		 $("#dtail").attr('href','{$staticHost}/show/orderDetail?order_id='+order_id);
			   		 $("#dtail").show();
			    }
			});
		});

	   
	  
	</script>

{template 'show/web-footer'}
